import re
from fnmatch import fnmatchcase

# 需要以忽略大小写的方式搜索与替换文本字符串
def demo_1():
    text = 'UPPER PYTHON, lower python, Mixed Python'
    find_result = re.findall('python', text, flags=re.IGNORECASE)
    print(find_result)
    replace_result = re.sub('python', 'snake', text, flags=re.IGNORECASE)
    print(replace_result)


if __name__ == '__main__':
    demo_1()
